﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QuestionnaireSubject.aspx.cs"
    Inherits=" ZX.TR.Web.QuestionnaireSubject" EnableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
    </style>
    <script src="../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table align="center" width="500px">
            <tr height="30px">
                <td align="right" width="80px">
                    问卷名称
                </td>
                <td width="150px">
                    <asp:TextBox ID="txtName" runat="server" Width="150px" Enabled="false"></asp:TextBox>
                </td>
                <td align="right" width="60px">
                    问卷类型
                </td>
                <td width="150px">
                    <asp:TextBox ID="txtType" runat="server" Width="150px" Enabled="false"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr height="20px">
                <td align="right"> 题目类型</td>
                <td>
                    <asp:DropDownList ID="drpType" runat="server" Width="155px" AutoPostBack="True" 
                        onselectedindexchanged="drpType_SelectedIndexChanged" AppendDataBoundItems="true">
                        <asp:ListItem Value="00">--选择题目类型--</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td align="right"> 题目角度</td>
                <td colspan="2">
                    <asp:DropDownList ID="drpAngle" runat="server" Width="155px" AutoPostBack="True" 
                        onselectedindexchanged="drpAngle_SelectedIndexChanged" AppendDataBoundItems="true">
                        <asp:ListItem Value="00">--选择题目角度--</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr height="20px">
                <td align="right"> 题目关键字</td>
                <td colspan="4">
                    <asp:TextBox ID="keywords" runat="server" Width="370px" AutoPostBack="True"  OnTextChanged="keywords_Changed" ToolTip="支持*,?模糊查询"></asp:TextBox>
                </td>
            </tr>
            <tr height="25px">
                <td align="right">
                    题目列表
                </td>
                <td>
                    <asp:ListBox ID="lstBoxSubject" runat="server" Height="150px" Width="155px"></asp:ListBox>
                </td>
                <td>
                    <asp:Button ID="btnMoveOne" runat="server" Text="—>" Width="50px" 
                        onclick="btnMoveOne_Click" /><br /><br />
                    <asp:Button ID="btnClearOne" runat="server" Text="<—" Width="50px" 
                        onclick="btnClearOne_Click" /><br /><br />
                    <asp:Button ID="btnMoveAll" runat="server" Text="—>>" Width="50px" onclick="btnMoveAll_Click" /><br /><br />
                    <asp:Button ID="btnClearAll" runat="server" Text="<<—" Width="50px" onclick="btnClearAll_Click" />
                </td>
                <td colspan="2" valign="top">
                    <asp:ListBox ID="lstBoxResult" runat="server" Height="150px" Width="155px"></asp:ListBox>
                </td>
            </tr>
            <asp:HiddenField ID="hiddenId" runat="server" />
            <asp:HiddenField ID="hiddenIts" runat="server" />
        </table>

        
    </div>
    </form>
</body>
<script type="text/javascript">
    function Save() {
        var list = document.getElementById("lstBoxResult");
        var subjectId = "";
        for (var i = 0; i < list.options.length; i++) {
            subjectId += list.options[i].value + ",";      
        }

        var questionnaireId = document.getElementById("hiddenId").value;
        var its = document.getElementById("hiddenIts").value;
        if (subjectId != "") {
            var url = "../Extend/AjaxData/DataProcessin.aspx?action=Save&entity=TrQuestionnaireSubject&id=" + questionnaireId + "&ids=" + subjectId + "&its=" + its;
            YAHOO.util.Connect.asyncRequest('POST', url, {
                success: function (res) {
                    var inventory;
                    try {
                        inventory = res.responseText;
                        if (inventory == 1) {
                            alert("保存成功!");
                            parent.closeWin(1);
                        } else {
                            alert(inventory + "\n" + "保存失败!");
                        }
                    }
                    catch (e) {
                    }
                    finally {
                    }
                },
                failure: function (error) {
                    alert("读取菜单数据错误：" + error.statusText);
                }
            }, null);
        } else {
            alert("您没有选择任何题目！");
        }
    }
</script>
</html>
